#include "samplechecker.h"
#include "sqlhelper.h"

SampleChecker::SampleChecker()
{
}

EttaError SampleChecker::checkSampleName(const Sample &sample)
{
    if (sample.name.trimmed().isEmpty())
    {
        return EttaError::EXP_SAMPLE_EMPTY;
    }

    if (SqlHelper::getInstance()->checkSampleNameExist(sample.name.trimmed()))
    {
        return EttaError::EXP_SAMPLE_ALREADY_EXIST;
    }

    return EttaError::OK;
}
